package com.example.houduan.Mapper;

import com.example.houduan.Pojo.RequiredMaterial;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface RequiredMaterialMapper {

    @Select("select count(*) from requiredmaterial")
    int selectRequiredMaterialCount();

    List<RequiredMaterial> selectRequiredMaterialLimit(int b,int e);

    @Delete("delete from requiredmaterial where meterial_id=#{meterial_id}")
    int deleteRequiredMaterial(Integer meterial_id);

    @Update("update requiredmaterial set title=#{title},message=#{message},update_time=#{update_time},medicalpolicy_id=#{medicalPolicy.medicalpolicy_id} where meterial_id=#{meterial_id}")
    int updateRequiredMaterial(RequiredMaterial requiredMaterial);

    @Insert("insert into requiredmaterial values (#{meterial_id},#{title},#{message},#{medicalPolicy.medicalpolicy_id},#{create_time},#{update_time})")
    int insertRequiredMaterial(RequiredMaterial requiredMaterial);
    
    List<RequiredMaterial> selectRequiredMaterialByConditions(Integer meterial_id, String title, String policy_title);
} 